package com.j.designpattern.adapter;

public class AdapterTest2 {
    public static void main(String[] args) {
        ChinaCharge chinaCharge = new ChinaCharge();

        Adapter2  adapter2 =new Adapter2(chinaCharge);
        adapter2.charge();

    }
}

//目标
 interface Target2{
    public void charge();
}

 class ChinaCharge {
     public void chinaCharge() {
         System.out.println("我是3个头头的充电器");
     }
}

//目标者
class GBCharge {
    public void gbCharge() {
        System.out.println("我是2个头头的充电器");
    }
}

//视频器
class Adapter2  implements Target2{

    ChinaCharge chinaCharge;

    public Adapter2(ChinaCharge chinaCharge) {
        this.chinaCharge = chinaCharge;
    }
    @Override
    public void charge() {
        chinaCharge.chinaCharge();

    }
}


